#ifndef IMPORTCSV_H
#define IMPORTCSV_H

#include <QtGui>
#include <QWidget>
#include <QFile>
#include <QTextStream>
#include <QDebug>
#include <QFileDialog>
#include "listeclient.h"
#include "formmainlist.h"

class ImportCSV : public QWidget
{
    Q_OBJECT

public:
    ImportCSV(QWidget *parent = 0);
    ~ImportCSV();

    static ListeClient ImportFile(QString filename);
private slots:
    void ChoixCategorie(int index);
    void Valider();
    void Ajouter();
signals:
    void EnvoiListeClientToDisplay(ListeClient liste);
    void EnvoiListeClient(ListeClient liste);

private:
    QStringList dataImport;
    QStringList listeHeader;
    QStringList listeType;
    QList<QComboBox*> m_listeComboBox;
    QPushButton *button;
    ListeClient m_ListeClientAjouter;

    FormMainList *m_formMainList;

    int indexNomlieu;
    int indexTypeClient;
    int indexDateProgrammation;
    int indexDistance;
    int indexCommentaires;
    int indexNumero;
    int indexRue;
    int indexCodePostal;
    int indexDepartement;
    int indexVille;
    int indexNomContact;
    int indexPrenomContact;
    int indexTelephone1Contact;
    int indexTelephone2Contact;
    int indexAdresseMailContact;
    int indexDernierContact;

    void CreationGUI();
    Client *CreationClient(QStringList dataImporter, QList<int> indexHeader);



};

#endif // IMPORTCSV_H
